package com.zsy.entity;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
//用户
public class User implements UserDetails {
    private Integer userid;
    //    用户名
    private  String username;
    //    密码
    private String password;
    //    手机号
    private  String phone;
    //    部门
    private String department;
    //    岗位
    private String position;
//    性别
    private String gender;
//    头像
    private String icon;

    private boolean enabled;  //账号是否可用
    private Collection<? extends GrantedAuthority> authorities;  //用户的权限集合

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }
}
